local skel = fk.CreateSkill {
  name = "rmt__shifo",
  tags = {Skill.Lord},
}

Fk:loadTranslationTable{
  ["rmt__shifo"] = "施佛",
  [":rmt__shifo"] = "主公技，其他梁势力角色的判定阶段开始时，若其判定区无牌，其可令你视为使用一张不可造成伤害的普通锦囊牌。",

  ["#rmt__shifo-invoke"] = "施佛：是否令 %dest 使用一张非伤害类锦囊牌？",
}

skel:addEffect(fk.EventPhaseStart, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    if target ~= player and player:hasSkill(skel.name) then
      if target.phase == Player.Judge then
        return target.kingdom == "liang" and #target:getCardIds("j") == 0 and not target.dead
      end
    end
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(target, { skill_name = self.name, prompt = "#rfenghou__shifo-invoke::"..player.id})
  end,
  on_use = function(self, event, target, player, data)
    local names = table.filter(Fk:getAllCardNames("t"), function (name)
      return not Fk:cloneCard(name).is_damage_card
    end)
    player.room:askToUseVirtualCard(player, {
      name = names, skill_name = skel.name, cancelable = false,
    })
  end,
})

return skel
